home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Original Shareware 1.1
/
The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso
/
19
/
madtrb14.zip
/
CDNORM.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1985-05-17
|
2KB
|
39 lines
(*-------------------------------------------------------------------------*)
(* CDNorm -- Cumulative normal distribution probability *)
(*-------------------------------------------------------------------------*)
FUNCTION CDNorm( X : REAL ) : REAL;
(*-------------------------------------------------------------------------*)
(* *)
(* Function: CDNorm *)
(* *)
(* Purpose: Evaluates cumulative normal distribution probability *)
(* *)
(* Calling Sequence: *)
(* *)
(* P := CDNorm( X ); *)
(* *)
(* X --- ordinate of normal distribution *)
(* *)
(* P --- Resultant cumulative probability *)
(* *)
(* Calls: *)
(* *)
(* Erf *)
(* *)
(* Method: *)
(* *)
(* The simple relationship between the error function and the *)
(* normal distribution is used. *)
(* *)
(*-------------------------------------------------------------------------*)
BEGIN (* CDNorm *)
IF X >= 0.0 THEN
CDNorm := ( 1.0 + Erf( X / Sqrt2 ) ) / 2.0
ELSE
CDNorm := ( 1.0 - Erf( -X / Sqrt2 ) ) / 2.0;
END (* CDNorm *);